package com.eco.service.impl;

import com.eco.dao.ds2.AiFishMapper2;
import com.eco.entity.AiFishEntity;
import com.eco.entity.AiFishTypeEntity;
import com.eco.entity.ChartDTO;
import com.eco.service.AiFishService2;
import com.github.pagehelper.PageHelper;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
/* loaded from: newfishway-1.0.0-SNAPSHOT.jar:BOOT-INF/classes/com/eco/service/impl/AiFishServiceImpl2.class */
public class AiFishServiceImpl2 implements AiFishService2 {

    @Autowired
    private AiFishMapper2 aiFishMapper2;

    @Override // com.eco.service.AiFishService2
    public int updateByAiFishEntity2(AiFishEntity aiFishEntity) {
        return this.aiFishMapper2.updateByAiFishEntity2(aiFishEntity);
    }

    @Override // com.eco.service.AiFishService2
    public List<AiFishEntity> findByDate2(String startDate, String endDate, int pageNum, int pageSize, String direction, String category, Float lenMin, Float lenMax) {
        PageHelper.startPage(pageNum, pageSize);
        List<AiFishEntity> datas = this.aiFishMapper2.findByDates2(startDate, endDate, direction, category, lenMin, lenMax);
        for (int i = 0; i < datas.size(); i++) {
            if (StringUtils.equals("right", datas.get(i).getSwim())) {
                datas.get(i).setSwim("上游");
            } else {
                datas.get(i).setSwim("下游");
            }
        }
        return datas;
    }

    @Override // com.eco.service.AiFishService2
    public List<AiFishEntity> findByRecordDateTime2(String startDate, String endDate) {
        List<AiFishEntity> datas = this.aiFishMapper2.findByDatesTime2(startDate, endDate);
        for (int i = 0; i < datas.size(); i++) {
            if (StringUtils.equals("right", datas.get(i).getSwim())) {
                datas.get(i).setSwim("0");
            } else {
                datas.get(i).setSwim("1");
            }
        }
        return datas;
    }

    @Override // com.eco.service.AiFishService2
    public void deleteById2(int[] ids) {
        this.aiFishMapper2.deleteById2(ids);
    }

    @Override // com.eco.service.AiFishService2
    public List<AiFishTypeEntity> findAllFishType2() {
        return this.aiFishMapper2.findAllFishType2();
    }

    @Override // com.eco.service.AiFishService2
    public List<ChartDTO> getFishCountByEveryday2(String startDate, String endDate) {
        return this.aiFishMapper2.getFishCountByEveryday2(startDate, endDate);
    }

    @Override // com.eco.service.AiFishService2
    public int countByRecordDate2(String startDate, String endDate, String direction, String category, Float lenMin, Float lenMax) {
        return this.aiFishMapper2.countByRecordDate2(startDate, endDate, direction, category, lenMin, lenMax);
    }

    @Override // com.eco.service.AiFishService2
    public int countAll2(String swim) {
        return this.aiFishMapper2.countAll2(swim);
    }

    @Override // com.eco.service.AiFishService2
    public AiFishEntity findById2(int id) {
        return this.aiFishMapper2.findById(id);
    }
}